import { RuleType } from "@midwayjs/validate";
import { BaseError } from "./base.error";

// 字符串
export const string = RuleType.string();

// 字符串不能为空
export const requiredString = string.required();


export function stringValidate(err?: string) {
  return RuleType.string().required().error(BaseError.validateError(err || '不能为空'));
}